﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="website_admin_sales_ordersettings" Codebehind="ordersettings.aspx.cs" %>

<%@ Register Src="../../admin/_root/_controls/ctlNavBar.ascx" TagName="ctlNavBar"
    TagPrefix="uc1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
    <title></title>

    <script type="text/javascript" src="../_static/_jQuery/jquery-1.3.2.min.js"></script>

    <script type="text/javascript" src="../../admin/_static/_jQuery/jquery_validator.js"></script>

    <script type="text/javascript" language="javascript" src="../_common/scripts/util.js"></script>

    <script language="javascript" src="../_static/_jQuery/jquery-fileupload.js" type="text/javascript"></script>

    <script language="javascript" src="../_static/_jQuery/jquery_json.js" type="text/javascript"></script>

    <script language="javascript" src="../_static/_jQuery/jquery_stringutil.js" type="text/javascript"></script>

    <script language="javascript" src="../_static/_jQuery/interface.js" type="text/javascript"></script>

    <link href="../_common/styles/frame_global.css" rel="stylesheet" type="text/css" />

    <script language="javascript" src="../../_common/datepicker/wdatepicker.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript">
    $(document).ready(setup);
    function setup()
    {
        validator.setup("#crmForm"); 
        if(getUrlParam("otype") == "modify")
        {
            LoadRegionList("init", "city", 1);
            LoadRegionList("init", "countie", 2);
            $("#txtPassword").attr("readonly", true);
            $("#txtPassword").val("12345678");
        }
    }
    function Cancel()
    {
        var groupid=getUrlParam("groupid");
        window.location.href="membersmaglist.aspx?groupid="+groupid;
    }
    function LoadRegionList(loadingtype, layername, _layer)
    {
        var _parentid = ""; 
        
        if(layername == "city")
            _parentid = $("#selProvinceList").val();
            
        if(layername == "countie")
            _parentid = $("#selCityList").val();
            
        if(_parentid != "")
	    {           
            if(loadingtype != "init")
            { 
                GetDrpListTextToTargetObj("selProvinceList", "txtRegionInfo"); 
 
                $("#txtProvinceId").val($("#selProvinceList").val());
            }
            
	        $.ajax({
                async   :   false,
                type    :   "POST",
                url     :   "memberinfoeditor.aspx",
                data    :   { otype : "getcitylist", _layername: layername, parentid : _parentid },
                success :   function(data, textStatus) {
                    switch(_layer)
                    {
                        case 1:
                            $("#selCityList").emptySelect().append(data).change(function() {
                                LoadRegionList("event", "countie", 2);
                                $("#txtRegionId").val($("#selCityList").val());
                                $("#txtCityId").val($("#selCityList").val());
                                
                                if($("#selCityList").val() != "0")
                                    $("#txtRegionInfo").val(GetDrpListText("selProvinceList") + " | " + GetDrpListText("selCityList"));
                                else 
                                    GetDrpListTextToTargetObj("selProvinceList", "txtRegionInfo");
                            });
                            break;
                        case 2:
                            $("#selCountiesList").emptySelect().append(data).change(function() {
                                $("#txtRegionId").val($("#selCountiesList").val());
                                $("#txtCountieId").val($("#selCountiesList").val());
                                
                                if($("#selCountiesList").val() != "0")
                                    $("#txtRegionInfo").val(GetDrpListText("selProvinceList") + " | " + GetDrpListText("selCityList") + " | " + GetDrpListText("selCountiesList"));
                                else
                                    $("#txtRegionInfo").val(GetDrpListText("selProvinceList") + " | " + GetDrpListText("selCityList"));
                            }); 
                            break;
                    }
                }
            });

            if(loadingtype == "init")
            {
                if($("#txtCountieId").val() != "0")
                    $("#selCountiesList").val($("#txtCountieId").val());
                if($("#txtCityId").val() != "0")
                    $("#selCityList").val($("#txtCityId").val());
            }
        }
        else
        {
            $("#selCityList").emptySelect().append("<option value=''>-- 请选择城市 --</option>");
            $("#selCountiesList").emptySelect().append("<option value=''>-- 请选择区县 --</option>");
            $("#txtProvinceId").val("0"); 
            $("#txtCityId").val("0"); 
            $("#txtCountieId").val("0");
            $("#txtRegionId").val("0");
            $("#txtRegionInfo").val("");
        }
    }
    function LoadFunctionDataList()
	{
	    
	}
    </script>

</head>
<body>

    <script type="text/javascript">
    <!--
        function ___doPostBack(eventTarget) { 
            var theForm = document.forms["crmForm"];
            if (!theForm) {
                theForm = document.crmForm;
            }
            if (!theForm.onsubmit || (theForm.onsubmit() != false)) { 
                theForm.___EVENTTARGET.value = eventTarget;
                theForm.submit();
            }
        }
    // -->
    </script>

    <div id="success" style="position: absolute; z-index: 300; height: 130px; width: 284px;
        left: 50%; top: 50%; margin-left: -150px; margin-top: -80px;">
        <div style="position: absolute; z-index: 300; width: 270px; height: 90px; background-color: #FFFFFF;
            border: solid #6699CC 1px; font-size: 14px;">
            <div style="height: 64px; line-height: 150%; padding: 0px 3px 0px 3px;" align="center">
                <br />
                <table>
                    <tr>
                        <td valign="top">
                            <img border="0" src="../_imgs/admin/progress.gif" />
                        </td>
                        <td valign="middle" style="font-size: 14px; width: 150px;">
                            操作执行中 ...<br />
                        </td>
                    </tr>
                </table>
                <br />
            </div>
        </div>
        <div style="position: absolute; width: 270px; height: 108px; z-index: 299; left: 4px;
            top: 5px; background-color: #E8E8E8; border: #E8E8E8 1px solid; display: none;">
        </div>
    </div>

    <script type="text/javascript">
        document.getElementById("success").style.display = "none"; 
    </script>

    <script src="../../admin/_static/_common/scripts/divcover.js" type="text/javascript"></script>

    <form id="crmForm" runat="server">
    <input type="hidden" name="___EVENTTARGET" id="___EVENTTARGET" value="" />
    <div class="divAreas">
        <div class="boxTopBar">
            <div class="boxTopBarLeft">
                <div class="navBar">
                    <uc1:ctlNavBar ID="ctlNavBar1" runat="server" />
                </div>
            </div>
            <div class="boxTopBarRight">
            </div>
        </div>
        <div class="boxMain">
            <div class="boxMainBody">
                <table cellpadding="0" cellspacing="0" class="stdTable" style="width: 98%;">
                    <tbody>
                        <tr style="height: 32px; background: #F0F0F0; padding-left: 10px; font-weight: bold;
                            text-align: left;">
                            <td>
                                订单信息
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" style="padding: 5px 5px 5px;">
                                <div class="orderContent">
                                    <label>
                                        订单状态：</label><span id="spanOrderType" runat="server"></span>
                                    <label>
                                        订单编号：</label>
                                        <span id="spanOrderNumber" runat="server"></span>
                                    <label>订购时间：</label>
                                        <span id="spanOrderDate" runat="server"></span>
                                    <label>
                                        订单总额：</label>￥<span id="spanTotalPrice" runat="server"></span>
                                     <label>
                                        订单状态：</label><span id="spanOrderStatus" runat="server"></span>
                                </div>
                                <div class="checkoutBox">
                                    <h4 class="title1">
                                        收货地址：</h4>
                                    <div class="clear">
                                    </div>
                                    <ul class="infoList">
                                        <li>
                                            <label>
                                                收货联系人：</label>
                                            <span id="spanShipToName" runat="server"></span></li>
                                        <li>
                                            <label>
                                                手&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;机：</label>
                                            <span id="spanShipMobile" runat="server"></span></li>
                                        <li>
                                            <label>
                                                联系电话：</label>
                                            <span id="spanShipTel" runat="server"></span></li>
                                        <li>
                                            <label>
                                                地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;区：</label>
                                            <span id="spanShipCounties" runat="server"></span></li>
                                        <li>
                                            <label>
                                                邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;编：</label>
                                            <span id="spanShipZip" runat="server"></span></li>
                                        <li>
                                            <label>
                                                送货地址：</label>
                                            <span id="spanShipAddress" runat="server"></span></li>
                                    </ul>
                                </div>
                                <div class="checkoutBox">
                                    <h4 class="title1">
                                        支付方式：
                                    </h4>
                                    <ul class="infoList">
                                        <li>
                                            <label>
                                                在线支付：
                                            </label>
                                            <span id="spanPaymentTypeName" runat="server"></span></li>
                                    </ul>
                                </div>
                                <div class="checkoutBox">
                                    <h4 class="title1">
                                        开票信息：</h4>
                                    <div id="divInvoice">
                                        <div id="normalInvoicePanel">
                                            <ul class="infoList edit">
                                                <li>
                                                    <label>
                                                        发票抬头：</label><span id="spanInvoiceTitle" runat="server"></span></li>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                                <div class="checkoutBox noBorder">
                                    <h4 class="title1">
                                        商品明细：
                                    </h4>
                                    <div id="divOrderItems">
                                        <asp:Repeater runat="server" ID="rptOrderItems">
                                            <HeaderTemplate>
                                                <table cellpadding="0" cellspacing="0" class="dataListControl" style="border-top: 1px solid #C2D4EB;">
                                                    <colgroup>
                                                        <col style="text-align: left; padding-left: 3px;" />
                                                        <col style="width: 100px; text-align: center;" />
                                                        <col style="width: 100px; text-align: center;" />
                                                        <col style="width: 100px; text-align: right; padding-right: 3px;" />
                                                    </colgroup>
                                                    <tbody>
                                                        <tr class="headerTitle1">
                                                            <td scope="col">
                                                                商品名称
                                                            </td>
                                                            <td scope="col">
                                                                价格
                                                            </td>
                                                            <td scope="col">
                                                                数量
                                                            </td>
                                                            <td scope="col">
                                                                小计
                                                            </td>
                                                        </tr>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <tr class="tr_items" onmouseover="this.style.backgroundColor='#FAFAFA'" onmouseout="this.style.backgroundColor='#FFFFFF'">
                                                    <td>
                                                        <a href="<%=OrderTypeCode.Replace("1", "../../product/productdetails.aspx?productid=").Replace("2", "../../group/gpdetails.aspx?id=") %><%#Eval("ProductId") %>" title="<%# Eval("ProductName")%>" target="_blank"
                                                            title="查看商品明细">
                                                            <%# Eval("ProductName")%></a>
                                                    </td>
                                                    <td>
                                                        ￥<%# Eval("UnitPrice")%>
                                                    </td>
                                                    <td>
                                                        <%# Eval("Quantity")%>
                                                    </td>
                                                    <td>
                                                        ￥<%# (decimal.Parse(Eval("UnitPrice").ToString()) * int.Parse(Eval("Quantity").ToString())).ToString()%>
                                                    </td>
                                                </tr>
                                            </ItemTemplate>
                                            <FooterTemplate>
                                                <tr>
                                                    <td class="footerBar" style="text-align: right;" colspan="4">
                                                        <div class="footerBox">
                                                            &nbsp;￥<%=TotalPrice %>
                                                        </div>
                                                    </td>
                                                </tr>
                                                </tbody></table></FooterTemplate>
                                        </asp:Repeater>
                                    </div>
                                </div>
                                <div class="checkoutBox noBorder">
                                    <h4 class="title1">
                                        备注信息：
                                    </h4>
                                    <div class="clear">
                                    </div>
                                    <ul class="infoList">
                                        <li>
                                            <label>
                                                备注信息：</label>
                                            <span id="spanComments" runat="server"></span></li>
                                    </ul>
                                </div>
                            </td>
                        </tr>
                        <tr style="height: 35px;">
                            <td class="WIN-Form-Bottom">
                                <input type="button" value="保存信息" id="btnSave" class="btn_s" onclick="if(validator.validatorAll()){this.disabled=true;success.style.display='block';HideOverSels('success');___doPostBack('save');}"
                                    style="width: 120px; height: 25px; margin: 0px 5px;" />
                                <input type="button" value="返回列表" id="btnCancel" class="btn_s" onclick="Cancel();"
                                    style="height: 25px; width: 120px; margin: 0px 5px;" />
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="boxBottomBar">
            <div class="boxBottomBarLeft">
                &nbsp;
            </div>
            <div class="boxBottomBarRight">
                &nbsp;
            </div>
        </div>
    </div>
    </form>
</body>
</html>
